package com.tools;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.login.R;

public class ServiceItem extends RelativeLayout {
    private TextView text;
    private ImageView image;

    public ServiceItem(Context context, AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater.from(getContext()).inflate(R.layout.service_item, this);
        TypedArray type = context.obtainStyledAttributes(attrs, R.styleable.ServiceItem);
        image = findViewById(R.id.service_item_icon);
        text = findViewById(R.id.service_item_text);

        image.setBackground(type.getDrawable(R.styleable.ServiceItem_ser_icon));
        text.setText(type.getString(R.styleable.ServiceItem_ser_text));
    }
}
